package com.sigmatrix.h5.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.sigmatrix.h5.dao.SalesAreaDao;
import com.sigmatrix.h5.entity.SalesArea;
import com.sigmatrix.sc.jdbc.common.dao.DaoImpl;

/**
 * 
 *@ClassName: SalesAreaDaoImpl
 *@Description: 销售区域
 *@author MH
 *@date 2017年9月27日 下午5:23:38
 */
@Repository
public class SalesAreaDaoImpl extends DaoImpl<SalesArea, Integer> implements SalesAreaDao{

	@Override
	public List<SalesArea> findByIds(Object ... ids) {
		StringBuffer sql = new StringBuffer();
		sql.append("select * from ").append(tableName());
		sql.append(" where 1=1 ");
		sql.append(" and _id in (");
		for (int i = 0; i < ids.length; i++) {
			sql.append("?,");
		}
		sql.replace(sql.length()-1, sql.length(), ")");
		return query(sql.toString(), ids);
	}

}
